package com.bamanker.cloudconsumer.feign;

import com.bamanker.cloudapi.model.error.CommonErrorCode;
import com.bamanker.cloudapi.model.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author bamanker
 */
@Component
@Slf4j
public class OrderFeignClientFallback implements BizClient {
    @Override
    public Object getInfo(String key) {
        log.error("调用接口 /info 失败，key={}", key);
        //return "OpenFeign 降级";
        throw new BusinessException(CommonErrorCode.UNKNOWN_ERROR, CommonErrorCode.UNKNOWN_ERROR.getMessage());
    }
}
